<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateOrderSignJoinMemberLog extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('open_shop_sign_order_permission_anchor', function (Blueprint $table) {
            $table->id();
            $table->string('orderNo', 60)->index('orderNo')->default('')->comment('订单编号');
            $table->string('provinceCode', 12)->index('provinceCode')->default('')->comment('省份code');
            $table->string('cityCode', 12)->default('')->comment('市级code');
            $table->string('districtCode', 12)->default('')->comment('区域code');
            $table->unsignedInteger('signInvestmentManagerId')->index('signInvestmentManagerId')->default(0)
                  ->comment('招商经理 Id');
            $table->unsignedInteger('localInvestmentManagerId')->index('localInvestmentManagerId')->default(0)
                  ->comment('选址开发经理 Id');
            $table->unsignedInteger('designUid')->index('designUid')->default(0)->comment('空间设计师 Id');
            $table->unsignedInteger('preparationUid')->index('preparationUid')->default(0)->comment('空间设计筹备确认人 Id');
            $table->unsignedInteger('checkManagerId')->index('checkManagerId')->default(0)->comment('工程确认人 Id');

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment   = '订单权限锚点表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('open_shop_sign_order_permission_anchor');
    }
}
